package com.lvjian.community.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.lvjian.community.dao.UserLoginMapper;
import com.lvjian.community.service.UserLoginService;

/**
 * 用户登录Service实现类
 * 
 */
@Service
public class UserLoginServiceImpl implements UserLoginService {

    @Autowired
    private UserLoginMapper userLoginMapper;

    @Override
    public boolean verifyPassword(String username, String password) {
        return userLoginMapper.verifyPassword(username, password) > 0;
    }

    @Override
    public int selectUserId(String username) {
        return userLoginMapper.selectUserId(username);
    }

    @Override
    public boolean updateLastLoginAt(String username) {
        return userLoginMapper.updateLastLoginAt(username) == 1;
    }

}
